<template>
	<view class="shop-container">
		<!-- 顶部导航栏 -->
		<view class="header">
			<view class="region-selector">
				<text>日本</text>
				<image src="/static/shop/5.png" mode="aspectFit" class="arrow-icon"></image>
			</view>
			<view class="search-bar">
				<image src="/static/shop/2.png" mode="aspectFit" class="search-icon"></image>
				<text class="search-placeholder">请输入搜索关键字</text>
			</view>
			<view class="header-icons">
				<image src="/static/shop/6.png" mode="aspectFit" class="cart-icon"></image>
				<image src="/static/shop/7.png" mode="aspectFit" class="notification-icon"></image>
			</view>
		</view>

		<!-- 分类选项卡 -->
		<view class="category-tabs">
			<view class="tab active">
				<text>全部</text>
			</view>
			<view class="tab">
				<text>直播</text>
			</view>
			<view class="tab">
				<text>特价</text>
			</view>
			<view class="tab">
				<text>店铺</text>
			</view>
			<view class="tab">
				<text>限时达</text>
			</view>
			<view class="tab">
				<image src="/static/shop/4.png" mode="aspectFit" class="grid-icon"></image>
			</view>
			<view class="tab">
				<image src="/static/shop/5.png" mode="aspectFit" class="list-icon"></image>
			</view>
		</view>

		<!-- 筛选选项 -->
		<view class="filter-options">
			<view class="filter-item">
				<text>综合</text>
				<image src="/static/shop/7.png" mode="aspectFit" class="arrow-icon"></image>
			</view>
			<view class="filter-item">
				<text>销量</text>
				<image src="/static/shop/7.png" mode="aspectFit" class="arrow-icon"></image>
			</view>
			<view class="filter-item">
				<text>价格</text>
				<image src="/static/shop/7.png" mode="aspectFit" class="arrow-icon"></image>
			</view>
			<view class="filter-item">
				<text>24小时发货</text>
			</view>
			<view class="filter-item">
				<text>包邮</text>
			</view>
		</view>

		<!-- 商品列表 -->
		<view class="product-list">
			<!-- 商品项 1 -->
			<view class="product-item">
				<view class="live-tag">
					<text>直播中</text>
				</view>
				<image src="/static/shop/shop1.png" mode="aspectFill" class="product-image"></image>
				<view class="product-info">
					<view class="product-title">
						<text>[Japan] Shiseido FINO</text>
					</view>
					<view class="product-desc">
						<text>保税直发 好评TOP1</text>
					</view>
					<view class="product-price">
						<text class="price">$89.00</text>
						<text class="sold">已售8w+</text>
					</view>
					<view class="product-tags">
						<text class="tag">日代洗发护发好价金牌...</text>
					</view>
				</view>
			</view>

			<!-- 商品项 2 -->
			<view class="product-item">
				<view class="live-tag">
					<text>直播中</text>
				</view>
				<image src="/static/shop/shop1.png" mode="aspectFill" class="product-image"></image>
				<view class="product-info">
					<view class="product-title">
						<text>[Japan] Givenchy双头</text>
					</view>
					<view class="product-desc">
						<text>运费险 仅剩12件</text>
					</view>
					<view class="product-price">
						<text class="price">$1602.00</text>
						<text class="sold">已售100+</text>
					</view>
					<view class="product-tags">
						<text class="tag">月代购21件 LAFAYETT海外</text>
					</view>
				</view>
			</view>

			<!-- 商品项 3 -->
			<view class="product-item">
				<view class="discount-tag">
					<text>5.2折</text>
				</view>
				<image src="/static/shop/shop1.png" mode="aspectFill" class="product-image"></image>
				<view class="product-info">
					<view class="product-title">
						<text>[Japan] 银座GP原感巴...</text>
					</view>
					<view class="product-desc">
						<text>运费险 仅剩12件</text>
					</view>
					<view class="product-price">
						<text class="price">$160.00</text>
						<text class="sold">已售100+</text>
					</view>
					<view class="product-tags">
						<text class="tag">月代购21件 LAFAYETT海外</text>
					</view>
				</view>
			</view>

			<!-- 商品项 4 -->
			<view class="product-item">
				<view class="live-tag">
					<text>直播中</text>
				</view>
				<image src="/static/shop/shop1.png" mode="aspectFill" class="product-image"></image>
				<view class="product-info">
					<view class="product-title">
						<text>[Japan] Shiseido FINO</text>
					</view>
					<view class="product-desc">
						<text>保税直发 好评TOP1</text>
					</view>
					<view class="product-price">
						<text class="price">$89.00</text>
						<text class="sold">已售5w+</text>
					</view>
					<view class="product-tags">
						<text class="tag">日代美容护肤好价金牌...</text>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script setup>

</script>

<style>
.shop-container {
	position: relative;
	background-color: #f5f5f5;
	min-height: 100vh;
}

/* 顶部导航栏样式 */
.header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20rpx 30rpx;
	background-color: #ffffff;
	border-bottom: 1px solid #f0f0f0;
	position: sticky;
	top: 0;
	z-index: 99;
	box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.03);
}

.region-selector {
	display: flex;
	align-items: center;
	font-weight: bold;
	font-size: 28rpx;
	color: #333;
	padding: 6rpx 10rpx;
	border-radius: 6rpx;
	background-color: rgba(0, 0, 0, 0.02);
}

.arrow-icon {
	width: 24rpx;
	height: 24rpx;
	margin-left: 6rpx;
}

.search-bar {
	display: flex;
	align-items: center;
	background-color: #f5f5f5;
	border-radius: 30rpx;
	padding: 12rpx 20rpx;
	width: 400rpx;
	border: 1px solid #eeeeee;
	box-shadow: inset 0 1rpx 3rpx rgba(0, 0, 0, 0.05);
}

.search-icon {
	width: 30rpx;
	height: 30rpx;
	margin-right: 10rpx;
}

.search-placeholder {
	color: #999;
	font-size: 24rpx;
}

.header-icons {
	display: flex;
	align-items: center;
}

.cart-icon,
.notification-icon {
	width: 44rpx;
	height: 44rpx;
	margin-left: 24rpx;
	opacity: 0.85;
	transition: opacity 0.2s;
}

.cart-icon:active,
.notification-icon:active {
	opacity: 0.6;
}

/* 分类选项卡样式 */
.category-tabs {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 24rpx 30rpx;
	background-color: #ffffff;
	border-bottom: 1px solid #f0f0f0;
	position: sticky;
	top: 90rpx;
	z-index: 98;
}

.tab {
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 26rpx;
	color: #333;
}

.tab.active {
	color: #000;
	font-weight: bold;
	position: relative;
}

.tab.active::after {
	content: '';
	position: absolute;
	bottom: -10rpx;
	left: 50%;
	transform: translateX(-50%);
	width: 40rpx;
	height: 4rpx;
	background-color: #ff4400;
	border-radius: 2rpx;
}

.grid-icon,
.list-icon {
	width: 30rpx;
	height: 30rpx;
}

/* 筛选选项样式 */
.filter-options {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20rpx 30rpx;
	background-color: #ffffff;
	border-bottom: 1px solid #f0f0f0;
	position: sticky;
	top: 174rpx;
	z-index: 97;
}

.filter-item {
	display: flex;
	align-items: center;
	font-size: 24rpx;
	color: #666;
	padding: 6rpx 12rpx;
	border-radius: 20rpx;
	transition: background-color 0.2s;
}

.filter-item:active {
	background-color: #f5f5f5;
}

.filter-item:first-child {
	color: #ff4400;
	font-weight: bold;
}

/* 商品列表样式 */
.product-list {
	display: flex;
	flex-wrap: wrap;
	padding: 20rpx;
	margin-bottom: 120rpx;
	/* 为底部导航栏留出空间 */
	background-color: #f8f8f8;
}

.product-item {
	width: 48%;
	margin-bottom: 20rpx;
	background-color: #fff;
	border-radius: 16rpx;
	overflow: hidden;
	position: relative;
	box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.08);
	margin-right: 2%;
	transition: transform 0.2s, box-shadow 0.2s;
}

.product-item:active {
	transform: translateY(2rpx);
	box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.06);
}

.live-tag,
.discount-tag {
	position: absolute;
	top: 10rpx;
	left: 10rpx;
	background-color: rgba(0, 0, 0, 0.7);
	color: #fff;
	font-size: 20rpx;
	padding: 6rpx 12rpx;
	border-radius: 6rpx;
	z-index: 1;
	box-shadow: 0 2rpx 6rpx rgba(0, 0, 0, 0.2);
	display: flex;
	align-items: center;
}

.live-tag::before {
	content: '';
	width: 8rpx;
	height: 8rpx;
	background-color: #ff4400;
	border-radius: 50%;
	margin-right: 6rpx;
	animation: pulse 1.5s infinite;
}

@keyframes pulse {
	0% {
		opacity: 0.6;
	}

	50% {
		opacity: 1;
	}

	100% {
		opacity: 0.6;
	}
}

.discount-tag {
	background-color: rgba(255, 0, 0, 0.8);
	background-image: linear-gradient(135deg, #ff4400, #ff7700);
}

.product-image {
	width: 100%;
	height: 300rpx;
	object-fit: cover;
	transition: transform 0.3s;
}

.product-item:active .product-image {
	transform: scale(1.03);
}

.product-info {
	padding: 20rpx 16rpx;
	background-color: #ffffff;
}

.product-title {
	font-size: 26rpx;
	font-weight: bold;
	color: #333;
	margin-bottom: 6rpx;
}

.product-desc {
	font-size: 22rpx;
	color: #666;
	margin-bottom: 10rpx;
}

.product-price {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 6rpx;
}

.price {
	font-size: 30rpx;
	color: #ff4400;
	font-weight: bold;
	display: flex;
	align-items: center;
}

.price::before {
	content: '$';
	font-size: 22rpx;
	margin-right: 2rpx;
	margin-top: -4rpx;
}

.sold {
	font-size: 20rpx;
	color: #999;
}

.product-tags {
	font-size: 20rpx;
	color: #999;
}

/* 底部导航栏样式 */
.tab-bar {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	height: 110rpx;
	background-color: #fff;
	display: flex;
	justify-content: space-around;
	align-items: center;
	border-top: 1px solid #f0f0f0;
	z-index: 100;
	box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
	padding-bottom: env(safe-area-inset-bottom);
}

.tab-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	height: 100%;
	width: 25%;
	transition: transform 0.2s;
}

.tab-item:active {
	transform: scale(0.92);
}

.tab-icon {
	width: 44rpx;
	height: 44rpx;
	margin-bottom: 6rpx;
	opacity: 0.8;
}

.tab-text {
	font-size: 20rpx;
	color: #666;
}

.tab-item.active .tab-icon {
	opacity: 1;
}

.tab-item.active .tab-text {
	color: #ff4400;
	font-weight: bold;
}
</style>
